'use strict';

const Sequelize = require('sequelize');
const sequelize = require('../util/sequelize');

var Notice = sequelize.define('notice', {
    toUserId: {
        type: Sequelize.STRING
    },
    unread: {
        type: Sequelize.INTEGER,
        defaultValue: 1
    },
    message: {
        type: Sequelize.TEXT
    },
    state: {
        type: Sequelize.INTEGER,
        defaultValue: 0,
    },
    readIP: {
        type: Sequelize.STRING,
        allowNull: true,
    },
    type: {
        type: Sequelize.STRING,
        allowNull: true,
    }
});

Notice.sync({
    force: false
});

module.exports = Notice;